// DlgConfirm.cpp : implementation file
//

#include "stdafx.h"
#include "Celsus.h"
#include "DlgConfirm.h"


// CDlgConfirm dialog

IMPLEMENT_DYNAMIC(CDlgConfirm, CDialog)

CDlgConfirm::CDlgConfirm(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgConfirm::IDD, pParent)
	, m_szAction(_T(""))
	, m_szConfirm(_T(""))
{

}

CDlgConfirm::~CDlgConfirm()
{
}

void CDlgConfirm::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_STATIC_ACTION, m_szAction);
	DDX_Text(pDX, IDC_EDIT_YES, m_szConfirm);
}


BEGIN_MESSAGE_MAP(CDlgConfirm, CDialog)
	ON_EN_CHANGE(IDC_EDIT_YES, &CDlgConfirm::OnEnChangeEditYes)
END_MESSAGE_MAP()


// CDlgConfirm message handlers

void CDlgConfirm::OnEnChangeEditYes()
{
	// update data
	UpdateData();
	// check for YES
	if( m_szConfirm == _T("YES") )
		GetDlgItem( IDOK )->EnableWindow();
	else
		GetDlgItem( IDOK )->EnableWindow( FALSE );
}
